Week 1 Practices (0902)

Author

Danny Po-Hsien Kang

Published

September 2, 2025

1 Assign Values

Create two variables called x and y, and assign values 20250902 and 1031. Compute x / y.

2 Help

Use the help() function to check docs, e.g. data.frame() or mean().

3 Matrix

Create the following vectors:

name_vec <- c("James", "Noc", "Monica")

age_vec <- c(25, 30, 28)

and create a 3 × 2 matrix with these two vectors.

Do you encounter errors? Can you print the matrix out? What’s the data type of the matrix?